<%@page import="team3.jobportal.controller.ApplicationController"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
 <style type="text/css">
 

 
div.row {
  clear: both;
  padding-top: 5px;
  }

div.row span.label {
  float: left;
  width: 100px;
  text-align: right;
  }

div.row span.formw {
  float: right;
  width: 300px;
  text-align: left;
  } 
  </style>
  <script type="text/javascript">
  function clearTextField(textBoxId)
  {
  document.getElementById(textBoxId).value="";
   }
  </script>
</head>
<body background="images\green_white_circles.jpg">

<jsp:useBean id="student" class="team3.jobportal.businesslogic.Student" scope="application"></jsp:useBean>
<jsp:setProperty name="student" property="fName" value="<%=request.getParameter(\"studentFirstName\") %>" />
<jsp:setProperty name="student" property="mName" value="<%=request.getParameter(\"studentMiddleName\") %>" />
<jsp:setProperty name="student" property="lName" value="<%=request.getParameter(\"studentLastName\") %>" />
<jsp:setProperty name="student" property="password" value="<%=request.getParameter(\"studentPassword\") %>" />
<jsp:setProperty name="student" property="emailId" value="<%=request.getParameter(\"studentEmailID\") %>" />
<jsp:setProperty name="student" property="secQn" value="<%=request.getParameter(\"studentSecurityQn\") %>" />
<jsp:setProperty name="student" property="secAns" value="<%=request.getParameter(\"studentSecurityAns\") %>" />
<jsp:setProperty name="student" property="accountCreated" value="<%=request.getParameter(\"createAccount\") %>" />


<div align="center">
	<br/><br/>
		Welcome New Student!!! 
	</div>
	
	<br/><br/>
	
	<div style="width: 430px; 
 padding: 5px;
margin: 0px auto;">
  <form method="post">
    <div class="row">
 <span class="label">Name</span>
 <span  class="formw">

     
       <input id="studentFirstName" style="width: 100px;" class="hintTextBox" value="First" onclick="clearTextField('studentFirstName');"/>   
        <input id="studentMiddleName" class="hintTextbox" style="width: 40px;" value="Middle"  onclick="clearTextField('studentMiddleName');"/>
	       <input id="studentLastName"  class="hintTextbox" style="width: 100px;" value="Last" onclick="clearTextField('studentLastName');" />	    
	       </span></div><br/> <br/>
	       
	        <div class="row">
      <span class="label">Email ID</span><span 
class="formw"><input type="text" size="50" name="studentEmailID" /></span>
    </div><br/><br/>
    
    <div class="row">
      <span class="label">Choose Password</span><span
class="formw"><input type="password" size="25" name="studentPassword" /></span>
    </div><br/><br/>
    <div class="row">
      <span class="label">Confirm Password</span><span
class="formw"><input type="password" size="25" name="studentPasswordConfirm"/></span>
    </div><br/><br/>
    
    <div class="row">
      <span class="label">Security Question</span><span
class="formw">
<select name="studentSecurityQn" style="width: 300px"> 
<option value="none"></option>
 <option value="pet">What is the name of your first pet?</option>
<option value="maidenname">What is your maiden name?</option>
</select>
</span>
    </div><br/><br/>
    
     <div class="row">
      <span class="label">Security Answer</span><span
class="formw"><input type="text" size="50" name="studentSecurityAns" /></span>
    </div><br/><br/>
    
   
    
       <div class="row">
      <span
class="formw"><input type="submit"  name="StudentCreateAccount" value="Create Account"/></span>
<input type="hidden" name="createAccount"> 
    </div>
    
    
    <br/><br/>
  
  <div class="spacer">
  &nbsp;
  </div>
 </form>

<%
	if((student.getEmailId()!=null) && (ApplicationController.getController().createStudentAccount(student)))
	{ %>
	  <jsp:forward page="StudentLogin.jsp"></jsp:forward>
	<%
	}else
	 {
	  if(student.getEmailId()!=null)
	  {
	  %>
	   <script type="text/javascript">
	   alert("Error creating the student account.");
	   </script>
	 <% }}
	 %>
</div>
	
	
	  
</body>
</html>